/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykht.proj.coupon.entity.FxReward;
import com.ykht.proj.coupon.vo.FxRewardView;
import com.ykht.proj.coupon.vo.FxRewardVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 服务员奖励记录表(待定)
 *
 * @author proj code generator
 * @date 2021-02-01 19:00:17
 */
@Mapper
public interface FxRewardMapper extends BaseMapper<FxReward> {
	/**
	 * 分销明细 分页查询
	 * @param page
	 * @param req
	 * @return
	 */
    IPage<FxRewardVo> findPage(Page page,  @Param("req") FxRewardVo req);

	/**
	 * 获取 分销明细 统计金额
	 * @param req
	 * @return
	 */
	FxRewardVo getSumByMoney(@Param("req")  FxRewardVo req);

	/**
	 *  获取饭友详情 的 核销明细 分页
	 * @param page
	 * @param req
	 * @return
	 */
    IPage<FxRewardVo> getWriteDetailsListPage(Page page, @Param("req") FxRewardVo req);

	/**
	 *  获取饭友详情 的 核销明细 统计（核销佣金 和 核销次数）
	 * @param req
	 * @return
	 */
	FxRewardVo getWriteDetailsCount(@Param("req") FxRewardVo req);

	/**
	 * 饭友详情的 饭友列表 分页
	 * @param page
	 * @param req
	 * @return
	 */
	IPage<FxRewardVo> getFanYouDetailsListPage(Page page,@Param("req") FxRewardVo req);

    List<FxRewardView> shopRewardTop(FxRewardView fxRewardView);

	List<FxRewardView> waiterRewardTop(FxRewardView fxRewardView);

	String queryUserNameByLoginId(Long loginId);

	List<Map> fxrwStatistics();

	/**
	 * 获取服务员的佣金收益 统计
	 * @param req
	 * @return
	 */
	FxRewardVo getSumByMoneyAndFind(@Param("req") FxRewardVo req);

	/**
	 * 获取服务员 佣金收益统计下边的饭友列表
	 * @param page
	 * @param req
	 * @return
	 */
	IPage<FxRewardVo> getCommissionRevenuesFanYouCount(Page page,@Param("req") FxRewardVo req);

	/**
	 * 获取服务员 收益明细 统计信息
	 * @param req
	 * @return
	 */
    FxRewardVo getCommissionRevenuesDetailed(@Param("req") FxRewardVo req);

	/**
	 * 获取服务员 收益明细 的列表
	 * @param page
	 * @param req
	 * @return
	 */
	IPage<FxRewardVo> getCommissionRevenuesFanYouDetailedList(Page page,@Param("req") FxRewardVo req);

	/**
	 * 获取服务员 收益明细 的类型 统计
	 * @param req
	 * @return
	 */
	FxRewardVo getCommissionRevenuesFanYouDetailedCount(@Param("req") FxRewardVo req);
}
